export default {
	data(){
		return {
			opacity:0,
			pageTitle:null,
		}
	},
	computed:{
		bgColor(){
			return `rgba(0,0,0,${this.opacity})`
		},
		titleStyle(){
			return {color:'#222'}
		}
	},
	onLoad(){
		uni.$on('onPageScroll',this.scrollChange)
	},
	mounted(){
		uni.$on('onPageScroll',this.scrollChange)
	},
	methods:{
		scrollChange({scrollTop}){
			this.opacity=scrollTop>=200? 1:scrollTop/200
			if(this.product?.name&&scrollTop>=120){
				this.pageTitle=this.product?.name
			}else{
				this.pageTitle=null
			}
		}
	}
}